package org.example.service.impl;

import org.example.mapper.GoodMapper;
import org.example.pojo.Good;
import org.example.pojo.Result;
import org.example.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class GoodServiceImpl implements GoodService {
    @Autowired
    private GoodMapper goodMapper;

    @Override
    public Result add(Good good) {
        goodMapper.insert(good);
        return Result.success(good);
    }

    @Override
    public Result getList() {
        return Result.success(goodMapper.list());
    }
}
